package com.tq.teaching_quality.controller;


import com.tq.teaching_quality.entity.SurveyAnswerSheet;
import com.tq.teaching_quality.service.SurveyAnswerSheetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 问卷答卷 前端控制器
 * </p>
 *
 * @author YTH
 * @since 2020-06-29
 */
@RestController
@RequestMapping("/survey-answer-sheet")
public class SurveyAnswerSheetController {

    @Autowired
    private SurveyAnswerSheetService surveyAnswerSheetService;

    //增加一条记录
    @RequestMapping("/AddSurveyAnswerSheet")
    public boolean AddSurveyAnswerSheet(@PathVariable("SurveyAnswerSheet") SurveyAnswerSheet surveyAnswerSheet){
        return surveyAnswerSheetService.save(surveyAnswerSheet);
    }

    //删除一条记录
    @RequestMapping("/DeleteSurveyAnswerSheet")
    public boolean DeleteSurveyAnswerSheet(@PathVariable("SurveyAnswerSheetId") Long surveyAnswerSheetId){
        return surveyAnswerSheetService.removeById(surveyAnswerSheetId);
    }

    //查询全部记录
    @RequestMapping("/SelectAllSurveyAnswerSheet")
    public List<SurveyAnswerSheet> SelectAllSurveyAnswerSheet(){
        return surveyAnswerSheetService.list();
    }

    //修改一条记录
    @RequestMapping("/UpdateSurveyAnswerSheet")
    public boolean UpdateSurveyAnswerSheet(@PathVariable("SurveyAnswerSheet") SurveyAnswerSheet surveyAnswerSheet){
        return surveyAnswerSheetService.updateById(surveyAnswerSheet);
    }





}

